<template>
  <van-search
    v-model="keywordTemp"
    :placeholder="placeholder"
    @search="onSearch"
    :show-action="showAction"
  >
    <template #action>
      <div @click="onSearch">搜索</div>
    </template>
  </van-search>
</template>

<script>
export default {
  name: "aSearch",
  props: {
    keyword: {
      type: String,
      default: "",
    },
    placeholder: {
      type: String,
      default: "请输入搜索标题",
    },
    showAction:Boolean
  },
  data() {
    return {
      keywordTemp: this.keyword,
    };
  },
  methods: {
    onSearch() {
      this.$emit("search", this.keywordTemp);
    },
  },
};
</script>

<style>
</style>